// 获取元素
const tabs = document.querySelectorAll('.tab');
const loginContents = document.querySelectorAll('.login-content');

// 切换登录标签页
tabs.forEach(tab => {
    tab.addEventListener('click', () => {
        tabs.forEach(t => t.classList.remove('active'));
        tab.classList.add('active');

        loginContents.forEach(content => content.classList.remove('active'));
        const targetContent = document.getElementById(tab.dataset.tab);
        targetContent.classList.add('active');
    });
});